<?php
/**
 * +--------------------------------------------------------+
 * @Created by PhpStorm.
 * @Category ArticleCollectCommand.php
 * @Depiction:
 * Author: hwy
 * Date: 2021/1/18  17:48
 * +--------------------------------------------------------+
 */

namespace App\Console\Commands;


use App\Handlers\CollectHandle;
use App\Services\CollectService;
use Carbon\Carbon;
use Illuminate\Console\Command;

class CollectArticleCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'command:collect_web_article';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '采集网站文章数据';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $this->info("获取开始..." . date('Y-m-d H:i:s'));
        $collect_handle = CollectService::getInstance();
        $collect_handle->collect_36kr();
        $collect_handle->collect_huxiu();
        $collect_handle->collect_tmtpost();
        $collect_handle->addDataDb();
        $this->info("获取结束..." . date('Y-m-d H:i:s'));
    }
}
